﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public enum TimeUnit
{
   Seconds, Minutes, Hours, Days
}

public static class Common
{
   public static DateTime NextTime(DateTime now, double add, TimeUnit unit)
   {
      DateTime result;

      switch (unit)
      {
         case TimeUnit.Seconds:
            result = now.AddSeconds(add);
            break;
         case TimeUnit.Minutes:
            result = now.AddMinutes(add);
            break;
         case TimeUnit.Hours:
            result = now.AddHours(add);
            break;
         case TimeUnit.Days:
            result = now.AddDays(add);
            break;
         default:
            result = now;
            break;
      }
      return result;
   }
}